package modules

import (
	"crypto/md5"
	"encoding/hex"
)

type UserInfo struct {
	UserName  string
	Passwd    string
	AuthToken string
	Role      string
	Prems     []map[string]string
}


func (U *UserInfo) PasswdMD5(p string) (string) {
	h_m5 := md5.New()
	h_m5.Write([]byte(p))
	m := hex.EncodeToString(h_m5.Sum(nil)) //密码MD5加密
	return m
}
